 <?php
$page_title ='Logout';
include('./includes/header.html');
if(!isset($_SESSION['first_name']))
	{
		$url ='http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
	if((substr($url,-1) =='/') or (substr($url,-1) =='\\'))
		$url = substr($url,0,-1);
		$url .= '/index.php';
		ob_end_clean();
		header("Location:$url");
		exit();
	}
	else{
	$_SESSION = array();
	session_destroy();
	setcookie(session_name(), '',time()-300,'/', '' ,0);
	}
echo "<h3>you are now logged out.</h3>";
include('./includes/footer.html');
?>